<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <textarea>
        啊啊啊啊啊啊啊啊啊啊啊
    </textarea>
    <div contenteditable="true">少时诵诗书</div>
<button onclick="c()">aaaaa</button>
</body>
<script>
    function c(){
        document.execCommand("insertHTML", false, "<a href='javascript:void(0);' onclick='alert(\"aa\")'>aaaaaa</a>")
    }
</script>
</html>